#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Project: spd-sxmcc
"""
@author: lyndon
@time Created on 2019/3/6 15:06
@desc
"""
import six
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.pool import NullPool


url = 'mysql://root:newpasswd@192.168.100.161:3306/task_test_db'
engine = create_engine(url, pool_size=10, max_overflow=10, pool_timeout=30, pool_recycle=5)
SessionFactory = sessionmaker(bind=engine)

def load_tasks():
    session = scoped_session(SessionFactory)
    res = []
    for tasks in session.execute('select taskid, project from teradata limit 10'):
        res.append(tasks)
    session.remove()
    return res

taask = list(load_tasks())

print(taask)

a = input('>>>')
